<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //讲数组进行扁平化处理。flat()，参数表示深度，默认1
        const arr1 = [1,2,3,[4,5,6,[7,6,99]]]
        //3-> 2
        console.log(arr1.flat())
        //3-> 1
        console.log(arr1.flat(2))
        const arr2 = [1,2,3,4,5,6]
        const arrmap = arr2.map(item=>[item*10])
        console.log(arrmap)
        //[[10],[20],[30],[40],[50],[60]]
        const arrflatmap = arr2.flatMap(item=>[item*10])
        console.log(arrflatmap)
        //
        

    </script>
</body>
</html>